package com.ctshk.app.system.controller;


import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.model.PageResponse;
import com.ctshk.common.web.support.BaseController;
import com.ctshk.rpc.system.dto.LoginLogDTO;
import com.ctshk.rpc.system.req.LoginLogReq;
import com.ctshk.rpc.system.service.ILoginLogService;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 操作日志表 前端控制器
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-03-26
 */
@RestController
@RequestMapping("/login-log")
public class LoginLogController extends BaseController {

    @DubboReference
    private ILoginLogService loginLogService;

    @ApiOperation(value = "登录日志列表", notes = "登录日志列表")
    @OperationLogAnnotation(operModul = OperationLogModel.SYSTEM, operType = OperationLogType.QUERY, operTitle = "登录日志列表", operDesc = "登录日志列表")
    @PostMapping(value = "/list")
    public Result<PageResponse<LoginLogDTO>> list(@RequestBody LoginLogReq req) {
        return Result.success(loginLogService.list(req));
    }

}
